﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.IO;

namespace WAI
{
    public class Step_SourcePath : InternalWizardPage
    {
        private TextBox textBox1;
        private TextBox textBox2;
        private Button button1;
        private System.ComponentModel.IContainer components = null;
        FolderBrowserDialog folderBrowserDialog1 = new FolderBrowserDialog();

        public Step_SourcePath()
        {
            // This call is required by the Windows Form Designer.
            InitializeComponent();

            // TODO: Add any initialization after the InitializeComponent call
        }

        /// <summary>
        /// Clean up any resources being used.
        /// </summary>
        protected override void Dispose(bool disposing)
        {
            if (disposing)
            {
                if (components != null)
                {
                    components.Dispose();
                }
            }
            base.Dispose(disposing);
        }

        #region Designer generated code
        /// <summary>
        /// Required method for Designer support - do not modify
        /// the contents of this method with the code editor.
        /// </summary>
        private void InitializeComponent()
        {
            this.textBox1 = new System.Windows.Forms.TextBox();
            this.textBox2 = new System.Windows.Forms.TextBox();
            this.button1 = new System.Windows.Forms.Button();
            this.SuspendLayout();
            // 
            // Banner
            // 
            this.Banner.Size = new System.Drawing.Size(452, 64);
            this.Banner.Subtitle = "Please select witch scripting technology your application uses";
            this.Banner.Title = "Choose Location";
            // 
            // textBox1
            // 
            this.textBox1.Location = new System.Drawing.Point(3, 70);
            this.textBox1.Multiline = true;
            this.textBox1.Name = "textBox1";
            this.textBox1.Size = new System.Drawing.Size(409, 38);
            this.textBox1.TabIndex = 1;
            this.textBox1.Text = "Please choose the location of the sources (Hier könnte man dann beliebige Sourceq" +
                "uellen akzeptieren und diese dann in die WAI-Ordnerstruktur importieren)";
            // 
            // textBox2
            // 
            this.textBox2.Location = new System.Drawing.Point(3, 114);
            this.textBox2.Name = "textBox2";
            this.textBox2.Size = new System.Drawing.Size(328, 20);
            this.textBox2.TabIndex = 2;
            this.textBox2.Text = "Please insert Path here or press the \"Browse\" Button";
            this.textBox2.TextChanged += new System.EventHandler(this.textBox2_TextChanged);
            // 
            // button1
            // 
            this.button1.Location = new System.Drawing.Point(337, 114);
            this.button1.Name = "button1";
            this.button1.Size = new System.Drawing.Size(75, 23);
            this.button1.TabIndex = 3;
            this.button1.Text = "Browse";
            this.button1.UseVisualStyleBackColor = true;
            this.button1.Click += new System.EventHandler(this.button1_Click);
            // 
            // Step_SourcePath
            // 
            this.Controls.Add(this.textBox1);
            this.Controls.Add(this.textBox2);
            this.Controls.Add(this.button1);
            this.Name = "Step_SourcePath";
            this.Size = new System.Drawing.Size(452, 317);
            this.SetActive += new CancelEventHandler(this.Step_SourcePath_SetActive);
            this.Controls.SetChildIndex(this.button1, 0);
            this.Controls.SetChildIndex(this.textBox2, 0);
            this.Controls.SetChildIndex(this.textBox1, 0);
            this.Controls.SetChildIndex(this.Banner, 0);
            this.ResumeLayout(false);
            this.PerformLayout();

        }
        #endregion

        private void Step_SourcePath_Load(object sender, EventArgs e)
        {
            
        }
        private void Step_SourcePath_SetActive(object sender, System.ComponentModel.CancelEventArgs e)
        {
            SetWizardButtons(WizardButtons.Back | WizardButtons.Next);
        }

        private void button1_Click(object sender, EventArgs e)
        {
            
            if (folderBrowserDialog1.ShowDialog() == DialogResult.OK)
            {
                this.textBox2.Text = folderBrowserDialog1.SelectedPath;
            }

        }

        private void textBox2_TextChanged(object sender, EventArgs e)
        {
            ProjectSettings.SourcePath = this.textBox2.Text;
        }

        private void Step_SourcePath_Close(object sender, EventArgs e)
        {

        }
    }
}
